package rgrouprouter

import (
	"vpn-management-server/src/controller/rgroupcontroller"
	"vpn-management-server/src/interceptor/rgroupinterceptor"
	"vpn-management-server/src/router/routermodel"
)

var rgroupRouter = routermodel.NewRouter()

func init() {
	// 规则 增删查
	rgroupRouter.RegisterHandleSet("addRGroup", rgroupinterceptor.AddRGroupValidator, rgroupcontroller.AddRGroup, rgroupinterceptor.AddRGroupLogToChan)
	rgroupRouter.RegisterHandleSet("getRGroupsByPage", rgroupinterceptor.GetRGroupValidator, rgroupcontroller.GetRGroupsByPage, nil)
	rgroupRouter.RegisterHandleSet("deleteRGroups", rgroupinterceptor.DeleteRGroupValidator, rgroupcontroller.DeleteRGroups, rgroupinterceptor.DeleteRGroupsLogToChan)
	// 用户组规则增删查
	rgroupRouter.RegisterHandleSet("grantRGroupToUGroup", rgroupinterceptor.GrantRGroupToUGroupValidator, rgroupcontroller.GrantRGroupToUGroup, nil)
	rgroupRouter.RegisterHandleSet("depriveRGroupFromUGroup", rgroupinterceptor.DepriveRGroupFromUGroupValidator, rgroupcontroller.DepriveRGroupFromUGroup, nil)
	rgroupRouter.RegisterHandleSet("deleteUGroupRGroups", rgroupinterceptor.DeleteUGroupRGroupValidator, rgroupcontroller.DeleteUGroupRGroups, nil)
	rgroupRouter.RegisterHandleSet("grantRGroupToUser", rgroupinterceptor.GrantRGroupToUserValidator, rgroupcontroller.GrantRGroupToUser, nil)
	rgroupRouter.RegisterHandleSet("depriveRGroupFromUser", rgroupinterceptor.DepriveRGroupFromUserValidator, rgroupcontroller.DepriveRGroupFromUser, nil)
	rgroupRouter.RegisterHandleSet("grantRuleToRGroup", rgroupinterceptor.GrantRuleToRGroupValidator, rgroupcontroller.GrantRuleToRGroup, nil)
	rgroupRouter.RegisterHandleSet("depriveRuleFromRGroup", rgroupinterceptor.DepriveRuleFromRGroupValidator, rgroupcontroller.DepriveRuleFromRGroup, nil)
	rgroupRouter.RegisterHandleSet("getRGroupRuleInfos", rgroupinterceptor.GetRGroupRuleInfosValidator, rgroupcontroller.GetRGroupRuleInfos, nil)
	rgroupRouter.RegisterHandleSet("getUserRGroupByPage", rgroupinterceptor.GetUserRGroupByPageValidator, rgroupcontroller.GetUserRGroupByPage, nil)
}
